Consider the indefinite [exponential integral](Exponential%20integrals.md) of a [[Gaussian function]], we can't evaluate it in terms of elementary functions and integral rules. However, the indefinite integral may be expressed as follows:
$\int_0^bdxe^{-x^2}=\frac{1}{2}\sqrt{\pi}\;\mbox{erf}{(a)}$
where $\mbox{erf}{(a)}$ is the [[Error function]], and $b$ is real.
If we are to integrate over the entire domain of a [[Gaussian function]]:
$I(x)=\int_{-\infty}^{\infty}dxe^{-ax^2}=\sqrt{\frac{\pi}{a}}$
where $a$ is real and $a>0$.
# Variations
## Relationship to the Fresnel Integral
An integral that looks similar to the [the Gaussian integral](Gaussian%20integral.md) over all of $\mathbb{R}$ is one where we replace $a$ with $-ai.$ It's worth mentioning since it yields a result that conveniently gives the same result as would be expected given the integration rule established for the Gaussian integral. Namely that
![](Fresnel%20integral#%5Ecde7ef)
However, $e^{iax^2}$ is a periodic function whose integral is a [complex Fresnel Integral](Fresnel%20integral.md#Complex%20Fresnel%20Integrals). This is no coincidence given the [proof](Fresnel%20integral.md#Proof%20of%20Gaussian%20look-alike).
## Integrals of form $\int dx x^ne^{-x^2}$
Here elementary integration rules work when $n$ is _odd_ (we already used that fact in finding $\int_{-\infty}^{\infty}dxe^{-ax^2}$), while the [[Error function]] appears when $n$ is even (and as a result the Gaussian function of form, $f(x)= x^ne^{-ax^2}$, is also even for even values of $n$). However the results generalizes in terms of the [[Gamma function]] in either case.
Hence:
$\int_0^{\infty}dx x^n e^{-ax^2} = \begin{cases}
\dfrac{\Gamma \big(\frac{n+1}{2}\big)}{2a^{\frac{n+1}{2}}},& (n>-1)\\[0.5em]
\dfrac{(2k-1)!!}{2^{k+1}a^k}\sqrt{\dfrac{\pi}{a}}, & n=2k\\[0.5em]
\dfrac{k!}{2(a^{k+1})}, & n = 2k+1
\end{cases}$
where $k$ is an integer and $a>0$
* __with $x^2$ factor:__
$\int_{-\infty}^{\infty}dx x^2 e^{-ax^2} = \frac{1}{2}\sqrt{\frac{\pi}{a^3}}$
---
# Proofs and Examples
## Evaluation of the Gaussian integral over $\mathbb{R}$
In order to find the improper integral over all $\mathbb{R}$ we don't necessarily need to invoke the [[Error function]]. We can make some progress by extending the Gaussian over 3 dimensions - which can be understood as multiplying together two Gaussians on orthogonal axes and taking the integral $I(x)=\sqrt{I^2(x)}=\sqrt{I(x)I(y)}$.
$I(x)=\sqrt{I^2(x)}=\sqrt{\bigg(\int_{-\infty}^{\infty}dxe^{-ax^2}\bigg)\bigg(\int_{-\infty}^{\infty}dxe^{-ax^2}\bigg)}=\sqrt{\bigg(\int_{-\infty}^{\infty}dx\int_{-\infty}^{\infty}dye^{-a(x^2+y^2)}\bigg)}$
$=\sqrt{\bigg(\int_{0}^{2\pi}d\theta\int_{0}^{\infty}dr re^{-a(r^2)}\bigg)}=\sqrt{\bigg(2\pi\int_{0}^{\infty}dr re^{-a(r^2)}\bigg)}=\sqrt{\bigg(-\frac{2\pi}{2a}\bigg)\bigg(e^{-a(r^2)}\bigg|_0^{\infty}\bigg)}=\sqrt{\frac{\pi}{a}}$
## Proof of finite integral with error function
#MathematicalFoundations/Analysis/Integrals